import request from '@/utils/request'
import type { ApiResponse } from '../index'
import type { LoginParams, LoginResponse } from '@/types/auth'

// 用户认证相关接口
export const authApi = {
  // 用户登录
  login(data: LoginParams) {
    return request.post<ApiResponse<LoginResponse>>('/auth/login', data)
  },
  
  // 用户注册
  register(data: { username: string; password: string }) {
    return request.post<ApiResponse>('/auth/register', data)
  },
  
  // 修改密码
  changePassword(data: { oldPassword: string; newPassword: string }) {
    return request.post<ApiResponse>('/auth/password/change', data)
  }
} 